var api = require('../../utils/api.js');
var app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        text:'',
        times:'',
        show:0,
        name:'',
        mobile:'',
        array:['内岗','店长（仅内场可申请）','公司运营（店长或店员均可申请）','']
    },

         
    bindPickerChanges(ret){
        console.log(ret);

        var index=ret.detail.value;
        var list=this.data.array;
        var text=list[index];
        
        this.setData({
            text:text
        })

     },
    onLoad(){
     },

     onShow(){
        var that=this;
        api.post({
            url: 'index/show',
            data: {},
            success: data => {
                console.log(data);
                that.setData({
                    show:data.data.show
                })
                
            }
        });
     },

     getname(re){
        this.setData({
            name:re.detail.value
        })
     },
     getmobile(ret){
        this.setData({
            mobile:ret.detail.value
        })
     },
    submits(){
        var that=this;
        var name=this.data.name;
        var mobile=this.data.mobile;
        var text=this.data.text;

        api.post({
            url: 'yuyue/jinsheng',
            data: {name:name,mobile:mobile,text:text},
            success: data => {
                console.log(data);
                
                wx.showToast({
                  title: data.msg,
                  icon:'none'
                })
            }
        });

    },
})